package com.wangyadong.hobby.schedule.jobtask.tree.example1;

import com.wangyadong.hobby.schedule.jobtask.tree.Position;


import java.util.Iterator;

public interface Tree<E> extends Iterable {
    int size();

    boolean isEmpty();

    boolean isRoot(Position position) throws IllegalArgumentException;

    boolean isExternal(Position p) throws IllegalArgumentException;

    boolean isInternal(Position p) throws IllegalArgumentException;

    Position<E> root();

    Position parent(Position position) throws IllegalArgumentException;

    Iterable<Position> child(Position position) throws IllegalArgumentException;


    Iterable<Position> position(Position position) throws IllegalArgumentException;

    int childNum(Position p) throws IllegalArgumentException;

}
